# 创建时间：2025/5/1 星期四 11:29
# 创建人：李德才

s1 = {10, 20, 30, 40, 50}
s2 = {30, 40, 50, 60, 70}
""" 并集"""
print(s1.union(s2))  ##  {10, 20, 30, 40, 50, 60, 70}
print("并集", s1 | s2)  ##  {10, 20, 30, 40, 50, 60, 70}
""" 交集"""
print(s1.intersection(s2))  ##  {30, 40, 50}
print("交集", s1 & s2)  ##  {30, 40, 50}
""" 差集"""
print("差集", s1.difference(s2))  ##  {10, 20}
print("差集", s1 - s2)  ##  {10, 20}
""" 对称差集"""
print("对称差集", s1.symmetric_difference(s2))  ##  {10, 20, 60, 70}
print("对称差集", s1 ^ s2)  ##  {10, 20, 60, 70}
